/*
 */

package com.railway.news.model;

import javax.validation.constraints.*;
import org.hibernate.validator.constraints.*;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

import java.util.*;
import org.apache.commons.lang.StringUtils;

import com.railway.common.base.*;
import com.railway.common.util.*;

import cn.org.rapid_framework.util.*;
import cn.org.rapid_framework.web.util.*;
import cn.org.rapid_framework.page.*;
import cn.org.rapid_framework.page.impl.*;

import com.railway.news.model.*;
import com.railway.news.dao.*;
import com.railway.news.service.*;
import com.railway.news.vo.query.*;

/**
 * @author  jiangcheng
 * @version 1.0
 * @since 1.0
 */


public class News extends BaseEntity implements java.io.Serializable {
	private static final Long serialVersionUID = 5454155825314635342L;
	//date formats
	public static final String FORMAT_CREATE_TIME = DATE_FORMAT;
	
	//可以直接使用: @Length(max=50,message="用户名长度不能大于50")显示错误消息
	//columns START
	@Length(max=32)
	private java.lang.String id;
	@Length(max=32)
	private java.lang.String catId;
	
	private java.lang.String catNames;
	
	@Length(max=200)
	private java.lang.String title;
	@Length(max=200)
	private java.lang.String dtitle;
	@Length(max=32)
	private java.lang.String authorId;
	
	private java.util.Date createTime;
	@Length(max=3000)
	private java.lang.String contentText;
	@Length(max=3000)
	private java.lang.String contentHtml;
	@Length(max=200)
	private java.lang.String fromName;
	@Length(max=200)
	private java.lang.String fromUrl;//题头图片
	
	private Integer browse;
	
	private Integer recom;
	
	private Integer topState;
	
	private Integer state;
	
	private String caTypes;  //展现类型从 栏目中继承
	
	//columns END

	public String getCaTypes() {
		return caTypes;
	}

	public void setCaTypes(String caTypes) {
		this.caTypes = caTypes;
	}

	public News(){
	}

	public News(
		java.lang.String id
	){
		this.id = id;
	}

	public void setId(java.lang.String value) {
		this.id = value;
	}
	
	public java.lang.String getId() {
		return this.id;
	}
	public void setCatId(java.lang.String value) {
		this.catId = value;
	}
	
	public java.lang.String getCatId() {
		return this.catId;
	}
	public void setTitle(java.lang.String value) {
		this.title = value;
	}
	
	public java.lang.String getTitle() {
		return this.title;
	}
	public void setDtitle(java.lang.String value) {
		this.dtitle = value;
	}
	
	public java.lang.String getDtitle() {
		return this.dtitle;
	}
	public void setAuthorId(java.lang.String value) {
		this.authorId = value;
	}
	
	public java.lang.String getAuthorId() {
		return this.authorId;
	}
	public String getCreateTimeString() {
		return DateConvertUtils.format(getCreateTime(), FORMAT_CREATE_TIME);
	}
	public void setCreateTimeString(String value) {
	//	setCreateTime(DateConvertUtils.parse(value, FORMAT_CREATE_TIME,java.util.Date.class));
	}
	
	public void setCreateTime(java.util.Date value) {
		this.createTime = value;
	}
	
	public java.util.Date getCreateTime() {
		return this.createTime;
	}
	public void setContentText(java.lang.String value) {
		this.contentText = value;
	}
	
	public java.lang.String getContentText() {
		return this.contentText;
	}
	public void setContentHtml(java.lang.String value) {
		this.contentHtml = value;
	}
	
	public java.lang.String getContentHtml() {
		return this.contentHtml;
	}
	public void setFromName(java.lang.String value) {
		this.fromName = value;
	}
	
	public java.lang.String getFromName() {
		return this.fromName;
	}
	public void setFromUrl(java.lang.String value) {
		this.fromUrl = value;
	}
	
	public java.lang.String getFromUrl() {
		return this.fromUrl;
	}
	public void setBrowse(Integer value) {
		this.browse = value;
	}
	
	public Integer getBrowse() {
		return this.browse;
	}
	public void setRecom(Integer value) {
		this.recom = value;
	}
	
	public Integer getRecom() {
		return this.recom;
	}
	public void setTopState(Integer value) {
		this.topState = value;
	}
	
	public Integer getTopState() {
		return this.topState;
	}
	public void setState(Integer value) {
		this.state = value;
	}
	
	public Integer getState() {
		return this.state;
	}

	public String toString() {
		return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
			.append("Id",getId())
			.append("CatId",getCatId())
			.append("Title",getTitle())
			.append("Dtitle",getDtitle())
			.append("AuthorId",getAuthorId())
			.append("CreateTime",getCreateTime())
			.append("ContentText",getContentText())
			.append("ContentHtml",getContentHtml())
			.append("FromName",getFromName())
			.append("FromUrl",getFromUrl())
			.append("Browse",getBrowse())
			.append("Recom",getRecom())
			.append("TopState",getTopState())
			.append("State",getState())
			.toString();
	}
	
	public int hashCode() {
		return new HashCodeBuilder()
			.append(getId())
			.toHashCode();
	}
	
	public boolean equals(Object obj) {
		if(obj instanceof News == false) return false;
		if(this == obj) return true;
		News other = (News)obj;
		return new EqualsBuilder()
			.append(getId(),other.getId())
			.isEquals();
	}

	public java.lang.String getCatNames() {
		return catNames;
	}

	public void setCatNames(java.lang.String catNames) {
		this.catNames = catNames;
	}
}

